﻿using Gadgeteer.Interfaces.Fakes;
using Gadgeteer.Interfaces.Timed;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gadgeteer.Interfaces.Sample.Safe.SafeApp.Tests
{
    [TestFixture]
    public class MultiColorLedAsDoorTest
    {
        [Test]
        public void Initial_Open_Close()
        {
            var fakeLock = new FakeLock();
            var led = new FakeMultiColorLed();

            var ledDoor = new MultiColorLedAsDoor(fakeLock, led);

            Assert.That(ledDoor.IsOpen, Is.False);
            Assert.That(led.Color, Is.EqualTo(Color.Red));


            fakeLock.Open();
            Assert.That(ledDoor.IsOpen, Is.True);
            Assert.That(led.Color, Is.EqualTo(Color.Green));

            fakeLock.Close();
            Assert.That(ledDoor.IsOpen, Is.False);
            Assert.That(led.Color, Is.EqualTo(Color.Red));
        }
    }
}
